<?xml version="1.0" encoding="utf-8"?>
<%@ include file="include.jsp" %>
<%@ page language="java" contentType="text/xml; charset=utf-8" pageEncoding="iso-8859-1" %>

<playlist version="0" xmlns="http://xspf.org/ns/0/">
    <trackList>

        <c:forEach var="song" items="${model.songs}">

            <c:url value="/stream" var="streamUrl">
                <c:param name="path" value="${song.mediaElement.path}"/>
            </c:url>

            <c:url value="coverArt.view" var="coverArtUrl">
                <c:param name="size" value="200"/>
                <c:if test="${not empty song.coverArtFile}">
                    <c:param name="path" value="${song.coverArtFile.path}"/>
                </c:if>
            </c:url>

            <track>
                <location>${streamUrl}</location>
                <image>${coverArtUrl}</image>
                <annotation>${song.mediaElement.parentName} - ${song.mediaElement.name}</annotation>
            </track>

        </c:forEach>

    </trackList>
</playlist>